import java.io.*; 
import java.util.*;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;




public class ViewDetail {

public static String userName = null;
public static String[] result=new String [500];
public static String DayNow = null;


public static void input_handle() {
    
      System.out.print("Please Enter your Student Id, Subject Name and Assignment Name seperated by commas : "); 

      
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));  

      
      try { 
         userName = br.readLine(); 
      } catch (IOException ioe) { 
         System.out.println("Error while submitting your assignment, please try again!"); 
         input_handle();
      }


 	int idx=0; int tokenCount;
    


	 result = userName.split(",");



      System.out.println(result[0]+", Thank you for submitting your assignment"); 


}






  public static void main(String[] args) throws IOException {


	input_handle();


    /*
    int index1 = result[3].lastIndexOf("."); 
    int index2 = result[3].length();  
    String index3 = result[3].substring(index1,index2); 


    File inputFile = new File(result[3]);
    File outputFile = new File("c:\\Agile\\Assignments\\"+result[0]+" "+result[1]+" "+result[2]+""+index3);

    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    int c;

    while ((c = in.read()) != -1)
    out.write(c);

    in.close();
    out.close();
*/


// file read


    File file = new File("..\\Agile\\Assignments\\"+result[0]+" "+result[1]+" "+result[2]+".txt");
    //File file = new File("..\\Agile\\Assignments\\615221x Agile as10.txt");

    FileInputStream fis = null;
    BufferedInputStream bis = null;
    DataInputStream dis = null;

    try {
      fis = new FileInputStream(file);

      // Here BufferedInputStream is added for fast reading.
      bis = new BufferedInputStream(fis);
      dis = new DataInputStream(bis);

      // dis.available() returns 0 if the file does not have more lines.
      while (dis.available() != 0) {

      // this statement reads the line from the file and print it to
        // the console.
        System.out.println(dis.readLine());
      }

      // dispose all the resources after using them.
      fis.close();
      bis.close();
      dis.close();

    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }


//

	
    
  }



}
